import { RouteRecordRaw, RouterView } from 'vue-router'
import layout from '@/layout/index.vue'

import { ShoppingBag } from '@element-plus/icons'

const routes: RouteRecordRaw = {
  path: '/product',
  component: layout,
  name: 'Product',
  meta: { icon: ShoppingBag, noCache: true },
  redirect: '/product/list',
  children: [
    {
      path: 'list',
      component: () => import('@/pages/product/list/index.vue'),
      name: 'ProductList',
    },
    {
      path: 'insert',
      component: () => import('@/pages/product/insert/index.vue'),
      name: 'InsertProduct',
    },
    {
      path: 'category',
      component: () => import('@/pages/product/category/index.vue'),
      name: 'ProductCategory',
    },
    {
      path: 'attr',
      component: () => import('@/pages/product/attr/index.vue'),
      name: 'ProductAttribute',
    },
    {
      path: 'comment',
      component: () => import('@/pages/product/comment/index.vue'),
      name: 'ProductComment',
    },
    // {
    //   path: 'test',
    //   component: RouterView,
    //   children: [
    //     {
    //       path: '1',
    //       // name: 'ProductTest1',
    //       component: () => import('@/pages/product/comment.vue'),
    //     },
    //     {
    //       path: '2',
    //       // name: 'ProductTest1',
    //       component: () => import('@/pages/product/comment.vue'),
    //     },
    //   ],
    // },
  ],
}

export default routes
